<template>
	<view>
		<!-- 若需显示自定义导航栏，需要在App.vue中引入Vue -->
		<!-- <cu-custom bgColor="bg-gradual-green">
			<block slot="content">支付结果</block>
		</cu-custom> -->
		
		<scroll-view scroll-y="true" >
			<view>
				<view class="topInfo bg-gradual-green">
					<view class="icon"><text class="cuIcon-roundcheck"></text></view>
					<view class="successLabel">支 付 成 功</view>
					<view class="notice">感谢您对我国扶贫工作的大力支持！</view>
					<view class="buttonArea">
						<button class="cu-btn round line-white lg" @click="backToIndex()"><text class="cuIcon-back"></text> 返回首页</button>
					</view>
				</view>
				<view class="recommand">
					<!-- 热卖商品  -->
					<view class="goodsView">
						<view class="goodsLabel">
							<view class="" style="text-align: right; margin-right: 30upx; float: right;">
								<!-- <image src="../../static/new.png" style="width: 50upx;height: 50upx;" mode=""></image> -->
							</view>
							
							<view class="" style="float: left;">
								<text class="cuIcon-title text-red"></text>
								猜你喜欢
							</view>
							
						</view>
						
						<view class="goodsContent">
							
								<view class="goodsItem" v-for="good in goodsList">
									<navigator :url="'/pages/goodsDetail/goodsDetail?id='+good.goodsId">
										<image style="width: 250upx;height: 250upx; border-radius: 15upx;" :src="'https://www.2306.tech/CCShop/images/goods/'+good.goodsId+'/'+good.goodsId+'-0.jpg'" mode=""></image>
										<view class="goodsName">{{good.goodsName}}</view>
										<view class="goodsPrice">￥{{good.goodsPrice}}</view>
									</navigator>
								</view>
							
							
						</view>
					</view>
				</view>
			</view>
		</scroll-view>
		
	</view>
</template>

<script>
	import {getIndexGoods} from '../../api/goodsAPI.js'
	export default {
		data() {
			return {
				goodsList:[]
			}
		},
		methods: {
			backToIndex(){
				uni.switchTab({
					url:'../index/index'
				})
			}
		},
		onLoad() {
			uni.showToast({
				icon:'success',
				title:'支付成功',
				duration:2000
			})	
			const app = getApp();
			getIndexGoods().then(resp => {
				this.goodsList = resp;
			})
		}
	}
</script>

<style>
	@import url("./paySuccess.css");
</style>
